package com.wanxi.variable;

public class VariableArg {
    public static void main(String[] args) {
//        sum(1, 2);
        sum("aa",1, 2, 3, 4, 5, 6, 7, 0);
    }

    private static void sum(int a, int b) {
        System.out.println(a + b);

    }

    private static void sum(String bb,int... aa) {
        int sum = 0;
        for (int i = 0; i < aa.length; i++) {
            sum += aa[i];
        }
        System.out.println(sum);

    }
}
